<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MolTK C++ API: C:/Users/cmbruns/svn/moltk/c++/include/moltk/units.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="moltk55.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MolTK C++ API
   &#160;<span id="projectnumber">0.3.0</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">C:/Users/cmbruns/svn/moltk/c++/include/moltk/units.h</div>  </div>
</div>
<div class="contents">
<a href="units_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment">    MolTK is a Python and C++ toolkit for protein sequence/structure alignment and visualization</span>
<a name="l00003"></a>00003 <span class="comment">    Copyright (C) 2011  Christopher M. Bruns</span>
<a name="l00004"></a>00004 <span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment">    This program is free software; you can redistribute it and/or modify</span>
<a name="l00006"></a>00006 <span class="comment">    it under the terms of the GNU General Public License as published by</span>
<a name="l00007"></a>00007 <span class="comment">    the Free Software Foundation; either version 2 of the License, or</span>
<a name="l00008"></a>00008 <span class="comment">    (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment">    This program is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment">    but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00013"></a>00013 <span class="comment">    GNU General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"></span>
<a name="l00015"></a>00015 <span class="comment">    You should have received a copy of the GNU General Public License along</span>
<a name="l00016"></a>00016 <span class="comment">    with this program; if not, write to the Free Software Foundation, Inc.,</span>
<a name="l00017"></a>00017 <span class="comment">    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.</span>
<a name="l00018"></a>00018 <span class="comment">    </span>
<a name="l00019"></a>00019 <span class="comment">    For questions contact: cmbruns@rotatingpenguin.com</span>
<a name="l00020"></a>00020 <span class="comment">*/</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="preprocessor">#ifndef MOLTK_UNITS_H</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#define MOLTK_UNITS_H</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span>
<a name="l00025"></a>00025 <span class="comment">// Boost::units does not play well with gcc-xml and msvc 9</span>
<a name="l00026"></a>00026 <span class="comment">// so I decided to roll my own.</span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="preprocessor">#include &quot;<a class="code" href="Real_8h.html">moltk/Real.h</a>&quot;</span>
<a name="l00029"></a>00029 
<a name="l00030"></a><a class="code" href="namespacemoltk_1_1units.html">00030</a> <span class="keyword">namespace </span>moltk { <span class="keyword">namespace </span>units {
<a name="l00031"></a>00031 
<a name="l00033"></a>00033     <span class="comment">// Dimensions //</span>
<a name="l00035"></a>00035 <span class="comment"></span>
<a name="l00036"></a><a class="code" href="structmoltk_1_1units_1_1dimension.html">00036</a>     <span class="keyword">struct </span><a class="code" href="structmoltk_1_1units_1_1dimension.html">dimension</a> {};
<a name="l00037"></a><a class="code" href="structmoltk_1_1units_1_1information__dimension.html">00037</a>     <span class="keyword">struct </span><a class="code" href="structmoltk_1_1units_1_1information__dimension.html">information_dimension</a> : <span class="keyword">public</span> <a class="code" href="structmoltk_1_1units_1_1dimension.html">dimension</a> {};
<a name="l00038"></a><a class="code" href="structmoltk_1_1units_1_1length__dimension.html">00038</a>     <span class="keyword">struct </span><a class="code" href="structmoltk_1_1units_1_1length__dimension.html">length_dimension</a> : <span class="keyword">public</span> <a class="code" href="structmoltk_1_1units_1_1dimension.html">dimension</a> {};
<a name="l00039"></a>00039 
<a name="l00041"></a>00041     <span class="comment">// Units //</span>
<a name="l00043"></a>00043 <span class="comment"></span>
<a name="l00044"></a>00044     <span class="keyword">template</span>&lt;<span class="keyword">class</span> D&gt;
<a name="l00045"></a><a class="code" href="structmoltk_1_1units_1_1unit.html">00045</a>     <span class="keyword">struct </span><a class="code" href="structmoltk_1_1units_1_1unit.html">unit</a> 
<a name="l00046"></a>00046     {
<a name="l00047"></a><a class="code" href="structmoltk_1_1units_1_1unit.html#a1c10e74ae42cd4d673baaf85ffdc7f28">00047</a>         <span class="keyword">typedef</span> D <a class="code" href="structmoltk_1_1units_1_1unit.html#a1c10e74ae42cd4d673baaf85ffdc7f28">dimension_type</a>;
<a name="l00048"></a><a class="code" href="structmoltk_1_1units_1_1unit.html#a05126ebaf085c503153546ad63234f95">00048</a>         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="structmoltk_1_1units_1_1unit.html#a05126ebaf085c503153546ad63234f95">print_name</a>(std::ostream&amp; os) {os &lt;&lt; <a class="code" href="namespacemoltk_1_1units.html#ad9a06c7227dae3a3383d06be8533d7c6">unit_name</a>(<a class="code" href="structmoltk_1_1units_1_1unit.html#abd012220b0b84fe4299a2236fcb6db3d">getInstance</a>());}
<a name="l00049"></a><a class="code" href="structmoltk_1_1units_1_1unit.html#af0b7f59ea2919c367e98b93b324f56b5">00049</a>         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="structmoltk_1_1units_1_1unit.html#af0b7f59ea2919c367e98b93b324f56b5">print_symbol</a>(std::ostream&amp; os) {os &lt;&lt; <a class="code" href="namespacemoltk_1_1units.html#a171e2d9b79caa174bb9321104a9e66fe">unit_symbol</a>(<a class="code" href="structmoltk_1_1units_1_1unit.html#abd012220b0b84fe4299a2236fcb6db3d">getInstance</a>());}
<a name="l00050"></a><a class="code" href="structmoltk_1_1units_1_1unit.html#abd012220b0b84fe4299a2236fcb6db3d">00050</a>         <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structmoltk_1_1units_1_1unit.html">unit</a>&amp; <a class="code" href="structmoltk_1_1units_1_1unit.html#abd012220b0b84fe4299a2236fcb6db3d">getInstance</a>() {
<a name="l00051"></a>00051             <span class="keyword">static</span> <a class="code" href="structmoltk_1_1units_1_1unit.html">unit</a>* singleton_pointer = NULL;
<a name="l00052"></a>00052             <span class="keywordflow">if</span> (! singleton_pointer) {
<a name="l00053"></a>00053                 singleton_pointer = <span class="keyword">new</span> <a class="code" href="structmoltk_1_1units_1_1unit.html">unit</a>();
<a name="l00054"></a>00054             }
<a name="l00055"></a>00055             <span class="keywordflow">return</span> *singleton_pointer;
<a name="l00056"></a>00056         }
<a name="l00057"></a>00057     <span class="keyword">private</span>:
<a name="l00058"></a>00058         <a class="code" href="structmoltk_1_1units_1_1unit.html">unit</a>() {} <span class="comment">// singleton provides no constructor</span>
<a name="l00059"></a>00059         unit(<span class="keyword">const</span> unit&amp;) {}
<a name="l00060"></a>00060     };
<a name="l00061"></a>00061 
<a name="l00062"></a><a class="code" href="namespacemoltk_1_1units.html#abd2f0e7f98c17a89d168c4ceea5846b5">00062</a>     <span class="keyword">typedef</span> <a class="code" href="structmoltk_1_1units_1_1unit.html">unit&lt;information_dimension&gt;</a> <a class="code" href="namespacemoltk_1_1units.html#abd2f0e7f98c17a89d168c4ceea5846b5">bit_t</a>;
<a name="l00063"></a><a class="code" href="namespacemoltk_1_1units.html#a171e2d9b79caa174bb9321104a9e66fe">00063</a>     <span class="keyword">inline</span> std::string <a class="code" href="namespacemoltk_1_1units.html#a171e2d9b79caa174bb9321104a9e66fe">unit_symbol</a>(<span class="keyword">const</span> <a class="code" href="structmoltk_1_1units_1_1unit.html">bit_t</a>&amp;) {<span class="keywordflow">return</span> <span class="stringliteral">&quot;b&quot;</span>;}
<a name="l00064"></a><a class="code" href="namespacemoltk_1_1units.html#ad9a06c7227dae3a3383d06be8533d7c6">00064</a>     <span class="keyword">inline</span> std::string <a class="code" href="namespacemoltk_1_1units.html#ad9a06c7227dae3a3383d06be8533d7c6">unit_name</a>(<span class="keyword">const</span> <a class="code" href="structmoltk_1_1units_1_1unit.html">bit_t</a>&amp;) {<span class="keywordflow">return</span> <span class="stringliteral">&quot;bit&quot;</span>;}
<a name="l00065"></a><a class="code" href="namespacemoltk_1_1units.html#a02758e42619234c003e6cbc612eebcfc">00065</a>     <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structmoltk_1_1units_1_1unit.html">bit_t</a>&amp; <a class="code" href="namespacemoltk_1_1units.html#a02758e42619234c003e6cbc612eebcfc">bit</a> = <a class="code" href="structmoltk_1_1units_1_1unit.html#abd012220b0b84fe4299a2236fcb6db3d">bit_t::getInstance</a>();
<a name="l00066"></a>00066 
<a name="l00067"></a><a class="code" href="namespacemoltk_1_1units.html#a89df1ee2fa329f269f49983df8fd2e7a">00067</a>     <span class="keyword">typedef</span> <a class="code" href="structmoltk_1_1units_1_1unit.html">unit&lt;length_dimension&gt;</a> <a class="code" href="namespacemoltk_1_1units.html#a89df1ee2fa329f269f49983df8fd2e7a">nanometer_t</a>;
<a name="l00068"></a>00068     <span class="keyword">inline</span> std::string <a class="code" href="namespacemoltk_1_1units.html#a171e2d9b79caa174bb9321104a9e66fe">unit_symbol</a>(<span class="keyword">const</span> <a class="code" href="structmoltk_1_1units_1_1unit.html">nanometer_t</a>&amp;) {<span class="keywordflow">return</span> <span class="stringliteral">&quot;nm&quot;</span>;}
<a name="l00069"></a>00069     <span class="keyword">inline</span> std::string <a class="code" href="namespacemoltk_1_1units.html#ad9a06c7227dae3a3383d06be8533d7c6">unit_name</a>(<span class="keyword">const</span> <a class="code" href="namespacemoltk_1_1units.html#a89df1ee2fa329f269f49983df8fd2e7a">nanometer_t</a>&amp;) {<span class="keywordflow">return</span> <span class="stringliteral">&quot;nanometer&quot;</span>;}
<a name="l00070"></a><a class="code" href="namespacemoltk_1_1units.html#ae6a5cb952aa94aa3cc02ad6f242d345d">00070</a>     <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="structmoltk_1_1units_1_1unit.html">nanometer_t</a>&amp; <a class="code" href="namespacemoltk_1_1units.html#ae6a5cb952aa94aa3cc02ad6f242d345d">nanometer</a> = <a class="code" href="structmoltk_1_1units_1_1unit.html#abd012220b0b84fe4299a2236fcb6db3d">nanometer_t::getInstance</a>();
<a name="l00071"></a>00071 
<a name="l00073"></a>00073     <span class="comment">// Quantities //</span>
<a name="l00075"></a>00075 <span class="comment"></span>
<a name="l00083"></a>00083     <span class="keyword">template</span>&lt;<span class="keyword">class</span> U, <span class="keyword">class</span> Y = Real&gt;
<a name="l00084"></a><a class="code" href="structmoltk_1_1units_1_1quantity.html">00084</a>     <span class="keyword">struct </span><a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">quantity</a> 
<a name="l00085"></a>00085     {
<a name="l00086"></a><a class="code" href="structmoltk_1_1units_1_1quantity.html#a6ac5d6e2e68cd5297da73eac03550008">00086</a>         <span class="keyword">typedef</span> U <a class="code" href="structmoltk_1_1units_1_1quantity.html#a6ac5d6e2e68cd5297da73eac03550008">unit_type</a>;
<a name="l00087"></a><a class="code" href="structmoltk_1_1units_1_1quantity.html#a2dc9d6a7898f9b697427e34eaa31a75c">00087</a>         <span class="keyword">typedef</span> Y <a class="code" href="structmoltk_1_1units_1_1quantity.html#a2dc9d6a7898f9b697427e34eaa31a75c">value_type</a>;
<a name="l00088"></a>00088 
<a name="l00089"></a><a class="code" href="structmoltk_1_1units_1_1quantity.html#a4e903ae904f984c7c33703a34c443c00">00089</a>         <a class="code" href="structmoltk_1_1units_1_1quantity.html#a2dc9d6a7898f9b697427e34eaa31a75c">value_type</a> <a class="code" href="structmoltk_1_1units_1_1quantity.html#a4e903ae904f984c7c33703a34c443c00">value</a>;
<a name="l00090"></a>00090 
<a name="l00091"></a>00091         <span class="comment">// constructors</span>
<a name="l00092"></a><a class="code" href="structmoltk_1_1units_1_1quantity.html#a80182877312069ead59777a2607bef61">00092</a>         <a class="code" href="structmoltk_1_1units_1_1quantity.html#a80182877312069ead59777a2607bef61">quantity</a>() {}
<a name="l00093"></a><a class="code" href="structmoltk_1_1units_1_1quantity.html#a0ba4c66ce9271d14b4ef836a63164bf4">00093</a>         <span class="keyword">explicit</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html#a0ba4c66ce9271d14b4ef836a63164bf4">quantity</a>(Y v) : <a class="code" href="structmoltk_1_1units_1_1quantity.html#a4e903ae904f984c7c33703a34c443c00">value</a>(v) {}
<a name="l00094"></a><a class="code" href="structmoltk_1_1units_1_1quantity.html#a3e429169fc58ed30a52923d6e85ce825">00094</a>         <a class="code" href="structmoltk_1_1units_1_1quantity.html#a3e429169fc58ed30a52923d6e85ce825">quantity</a>(<span class="keyword">const</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">quantity&lt;U,Y&gt;</a>&amp; rhs) : <a class="code" href="structmoltk_1_1units_1_1quantity.html#a4e903ae904f984c7c33703a34c443c00">value</a>(rhs.<a class="code" href="structmoltk_1_1units_1_1quantity.html#a4e903ae904f984c7c33703a34c443c00">value</a>) {}
<a name="l00095"></a>00095 
<a name="l00096"></a>00096         <span class="comment">// arithmetic operators</span>
<a name="l00097"></a><a class="code" href="structmoltk_1_1units_1_1quantity.html#ae1f6aa3e25502f1119ff9155a7085f80">00097</a>         <a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">quantity&lt;U,Y&gt;</a> <a class="code" href="structmoltk_1_1units_1_1quantity.html#ae1f6aa3e25502f1119ff9155a7085f80">operator+</a>(<span class="keyword">const</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">quantity&lt;U,Y&gt;</a>&amp; rhs)<span class="keyword"> const </span>{
<a name="l00098"></a>00098             <span class="keywordflow">return</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html#a80182877312069ead59777a2607bef61">quantity</a>(<a class="code" href="structmoltk_1_1units_1_1quantity.html#a4e903ae904f984c7c33703a34c443c00">value</a> + rhs.<a class="code" href="structmoltk_1_1units_1_1quantity.html#a4e903ae904f984c7c33703a34c443c00">value</a>);
<a name="l00099"></a>00099         }
<a name="l00100"></a>00100 
<a name="l00101"></a><a class="code" href="structmoltk_1_1units_1_1quantity.html#a820269613de38030d51785ff5671e94a">00101</a>         <a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">quantity&lt;U,Y&gt;</a> <a class="code" href="structmoltk_1_1units_1_1quantity.html#a820269613de38030d51785ff5671e94a">operator-</a>(<span class="keyword">const</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">quantity&lt;U,Y&gt;</a>&amp; rhs)<span class="keyword"> const </span>{
<a name="l00102"></a>00102             <span class="keywordflow">return</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">quantity&lt;U,Y&gt;</a>(<a class="code" href="structmoltk_1_1units_1_1quantity.html#a4e903ae904f984c7c33703a34c443c00">value</a> - rhs.<a class="code" href="structmoltk_1_1units_1_1quantity.html#a4e903ae904f984c7c33703a34c443c00">value</a>);
<a name="l00103"></a>00103         }
<a name="l00104"></a>00104 
<a name="l00105"></a><a class="code" href="structmoltk_1_1units_1_1quantity.html#ab46cbbdb33e21c552fbecf134387f73f">00105</a>         <a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">quantity&lt;U,Y&gt;</a> <a class="code" href="structmoltk_1_1units_1_1quantity.html#ab46cbbdb33e21c552fbecf134387f73f">operator-</a>()<span class="keyword"> const </span>{
<a name="l00106"></a>00106             <span class="keywordflow">return</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">quantity&lt;U,Y&gt;</a>(-<a class="code" href="structmoltk_1_1units_1_1quantity.html#a4e903ae904f984c7c33703a34c443c00">value</a>);
<a name="l00107"></a>00107         }
<a name="l00108"></a>00108 
<a name="l00109"></a><a class="code" href="structmoltk_1_1units_1_1quantity.html#a695715f009bb0319dfae9cefcbb9a296">00109</a>         <a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">quantity&lt;U,Y&gt;</a> <a class="code" href="structmoltk_1_1units_1_1quantity.html#a695715f009bb0319dfae9cefcbb9a296">operator*</a>(<a class="code" href="namespacemoltk.html#afe6fbd8f5686b34143c2742fcc97292c">Real</a> rhs)<span class="keyword"> const </span>{
<a name="l00110"></a>00110             <span class="keywordflow">return</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">moltk::units::quantity&lt;U,Y&gt;</a>(<a class="code" href="structmoltk_1_1units_1_1quantity.html#a4e903ae904f984c7c33703a34c443c00">value</a> * rhs);
<a name="l00111"></a>00111         }
<a name="l00112"></a>00112 
<a name="l00113"></a><a class="code" href="structmoltk_1_1units_1_1quantity.html#a7fbcbcf13944e7ac0e08a0129b49359b">00113</a>         <span class="keywordtype">bool</span> operator&lt;(const quantity&lt;U,Y&gt;&amp; rhs) <span class="keyword">const</span> {
<a name="l00114"></a>00114             <span class="keywordflow">return</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html#a4e903ae904f984c7c33703a34c443c00">value</a> &lt; rhs.value;
<a name="l00115"></a>00115         }
<a name="l00116"></a>00116 
<a name="l00117"></a><a class="code" href="structmoltk_1_1units_1_1quantity.html#a0add1b49258b9521650b0cb756600267">00117</a>         <span class="keywordtype">bool</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html#a0add1b49258b9521650b0cb756600267">operator&gt;</a>(<span class="keyword">const</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">quantity&lt;U,Y&gt;</a>&amp; rhs)<span class="keyword"> const </span>{
<a name="l00118"></a>00118             <span class="keywordflow">return</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html#a4e903ae904f984c7c33703a34c443c00">value</a> &gt; rhs.<a class="code" href="structmoltk_1_1units_1_1quantity.html#a4e903ae904f984c7c33703a34c443c00">value</a>;
<a name="l00119"></a>00119         }
<a name="l00120"></a>00120 
<a name="l00121"></a><a class="code" href="structmoltk_1_1units_1_1quantity.html#a47ebd03b16f81f99c29d396b1bb3721f">00121</a>         <span class="keywordtype">bool</span> operator&lt;=(const quantity&lt;U,Y&gt;&amp; rhs) <span class="keyword">const</span> {
<a name="l00122"></a>00122             <span class="keywordflow">return</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html#a4e903ae904f984c7c33703a34c443c00">value</a> &lt;= rhs.value;
<a name="l00123"></a>00123         }
<a name="l00124"></a>00124 
<a name="l00125"></a><a class="code" href="structmoltk_1_1units_1_1quantity.html#a56ad75b7e5e8fb355e79e424c75ce5bb">00125</a>         <span class="keywordtype">bool</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html#a56ad75b7e5e8fb355e79e424c75ce5bb">operator&gt;=</a>(<span class="keyword">const</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">quantity&lt;U,Y&gt;</a>&amp; rhs)<span class="keyword"> const </span>{
<a name="l00126"></a>00126             <span class="keywordflow">return</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html#a4e903ae904f984c7c33703a34c443c00">value</a> &gt;= rhs.<a class="code" href="structmoltk_1_1units_1_1quantity.html#a4e903ae904f984c7c33703a34c443c00">value</a>;
<a name="l00127"></a>00127         }
<a name="l00128"></a>00128 
<a name="l00129"></a><a class="code" href="structmoltk_1_1units_1_1quantity.html#af445960e962b942e32be2a82957ba54d">00129</a>         <span class="keywordtype">void</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html#af445960e962b942e32be2a82957ba54d">print</a>(std::ostream&amp; os)<span class="keyword"> const </span>{
<a name="l00130"></a>00130             os &lt;&lt; <a class="code" href="structmoltk_1_1units_1_1quantity.html#a4e903ae904f984c7c33703a34c443c00">value</a> &lt;&lt; <span class="stringliteral">&quot; &quot;</span>;
<a name="l00131"></a>00131             unit_type::print_symbol(os);
<a name="l00132"></a>00132         }
<a name="l00133"></a>00133 
<a name="l00134"></a>00134     };
<a name="l00135"></a>00135 
<a name="l00136"></a><a class="code" href="namespacemoltk_1_1units.html#ae48aa197908105b66ab2f3649669ff46">00136</a>     <span class="keyword">typedef</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">quantity&lt;bit_t&gt;</a> <a class="code" href="namespacemoltk_1_1units.html#ae48aa197908105b66ab2f3649669ff46">Information</a>;
<a name="l00137"></a><a class="code" href="namespacemoltk_1_1units.html#a9176b46b85649a9f074e753c21f441ea">00137</a>     <span class="keyword">typedef</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">quantity&lt;nanometer_t&gt;</a> <a class="code" href="namespacemoltk_1_1units.html#a9176b46b85649a9f074e753c21f441ea">Length</a>;
<a name="l00138"></a>00138 
<a name="l00139"></a>00139 <span class="keyword">template</span>&lt;<span class="keyword">class</span> U, <span class="keyword">class</span> Y&gt;
<a name="l00140"></a><a class="code" href="namespacemoltk_1_1units.html#ae61ede8dfb4151568856f55f47d78077">00140</a> <span class="keyword">inline</span> std::ostream&amp; operator&lt;&lt;(std::ostream&amp; os, const quantity&lt;U,Y&gt;&amp; q) {
<a name="l00141"></a>00141     q.print(os);
<a name="l00142"></a>00142     <span class="keywordflow">return</span> os;
<a name="l00143"></a>00143 }
<a name="l00144"></a>00144 
<a name="l00145"></a>00145 <span class="keyword">template</span>&lt;<span class="keyword">class</span> D, <span class="keyword">class</span> Y&gt;
<a name="l00146"></a><a class="code" href="namespacemoltk_1_1units.html#a246167f84b1b98d46fcd391cf065f20c">00146</a> <span class="keyword">inline</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">quantity&lt;unit&lt;D&gt;</a>,Y&gt; <a class="code" href="namespacemoltk_1_1units.html#a246167f84b1b98d46fcd391cf065f20c">operator*</a>(<span class="keyword">const</span> Y&amp; lhs, <span class="keyword">const</span> <a class="code" href="structmoltk_1_1units_1_1unit.html">unit&lt;D&gt;</a>&amp; rhs) {
<a name="l00147"></a>00147     <span class="keywordflow">return</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">quantity&lt;unit&lt;D&gt;</a>,Y&gt;(lhs);
<a name="l00148"></a>00148 }
<a name="l00149"></a>00149 
<a name="l00150"></a>00150 <span class="keyword">template</span>&lt;<span class="keyword">class</span> U, <span class="keyword">class</span> Y&gt;
<a name="l00151"></a><a class="code" href="namespacemoltk_1_1units.html#aad053a6125c41400af98de53e172a796">00151</a> <span class="keyword">inline</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">quantity&lt;U,Y&gt;</a> <a class="code" href="namespacemoltk_1_1units.html#a246167f84b1b98d46fcd391cf065f20c">operator*</a>(<a class="code" href="namespacemoltk.html#afe6fbd8f5686b34143c2742fcc97292c">moltk::Real</a> lhs, <span class="keyword">const</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">quantity&lt;U,Y&gt;</a>&amp; rhs) {
<a name="l00152"></a>00152     <span class="keywordflow">return</span> <a class="code" href="structmoltk_1_1units_1_1quantity.html" title="For efficiency, quantity&lt;&gt; should compile to a double in C++.">quantity&lt;U,Y&gt;</a>(lhs * rhs.<a class="code" href="structmoltk_1_1units_1_1quantity.html#a4e903ae904f984c7c33703a34c443c00">value</a>);
<a name="l00153"></a>00153 }
<a name="l00154"></a>00154 
<a name="l00155"></a>00155 }} <span class="comment">// namespace moltk::units</span>
<a name="l00156"></a>00156 
<a name="l00157"></a>00157 
<a name="l00158"></a>00158 <span class="preprocessor">#endif // MOLTK_UNITS_H</span>
<a name="l00159"></a>00159 <span class="preprocessor"></span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
